package com.aspose.cells;

class zaye {
   private zur a;
   private int b;
   private int c;
   private short d;
   private short e;
   private byte f;

   public zaye() {
   }

   public zaye(zur var1, int var2, int var3, int var4, int var5) {
      this.a = var1;
      this.b = var2;
      this.d = (short)var3;
      this.c = var4;
      this.e = (short)var5;
   }

   public zaye(zur var1, int var2, int var3) {
      this.a = var1;
      this.b = var2;
      this.d = (short)var3;
      this.c = var2;
      this.e = this.d;
   }

   public zaye(zur var1, CellArea var2) {
      this.a = var1;
      this.b = var2.StartRow;
      this.d = (short)var2.StartColumn;
      this.c = var2.EndRow;
      this.e = (short)var2.EndColumn;
   }

   public zaye(zaye var1) {
      this.a(var1);
   }

   void a(zaye var1) {
      this.a = var1.a;
      this.b = var1.b;
      this.d = var1.d;
      this.c = var1.c;
      this.e = var1.e;
      this.f = var1.f;
   }

   public zur a() {
      return this.a;
   }

   public void a(zur var1) {
      this.a = var1;
   }

   zur a(zaay var1) {
      return this.a != null && ((this.a.b & '\uffff') != 65534 || (this.a.c & '\uffff') != 65534 || var1.p.g.v().a(this.a.a & '\uffff').a() != 5) ? this.a : null;
   }

   public int b() {
      return this.b;
   }

   public void a(int var1) {
      this.b = var1;
   }

   public boolean c() {
      return (this.f & 255 & 128) == 0;
   }

   public void a(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f & 127);
      } else {
         this.f = (byte)(this.f | 128);
      }

   }

   public int d() {
      return this.d;
   }

   public void b(int var1) {
      this.d = (short)var1;
   }

   public boolean e() {
      return (this.f & 255 & 64) == 0;
   }

   public void b(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f & 191);
      } else {
         this.f = (byte)(this.f | 64);
      }

   }

   public int f() {
      return this.c;
   }

   public void c(int var1) {
      this.c = var1;
   }

   public boolean g() {
      return (this.f & 255 & 32) == 0;
   }

   public void c(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f & 223);
      } else {
         this.f = (byte)(this.f | 32);
      }

   }

   public int h() {
      return this.e;
   }

   public void d(int var1) {
      this.e = (short)var1;
   }

   public boolean i() {
      return (this.f & 255 & 16) == 0;
   }

   public void d(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f & 239);
      } else {
         this.f = (byte)(this.f | 16);
      }

   }

   public boolean j() {
      return (this.f & 255 & 160) != 0;
   }

   public boolean k() {
      return (this.f & 255 & 80) != 0;
   }

   public boolean l() {
      return (this.f & 255 & 240) != 0;
   }

   public boolean m() {
      return this.b == this.c && this.d == this.e && (this.a == null || this.a.b == this.a.c);
   }

   public boolean n() {
      return this.b == this.c;
   }

   public boolean o() {
      return this.d == this.e;
   }

   public int p() {
      return this.e - this.d + 1;
   }

   public int q() {
      return this.c - this.b + 1;
   }

   boolean r() {
      return (this.f & 255 & 8) != 0;
   }

   void e(boolean var1) {
      if (var1) {
         this.f = (byte)(this.f | 8);
      } else {
         this.f = (byte)(this.f & 247);
      }

   }

   void s() {
      boolean var2;
      if (this.b > this.c) {
         int var1 = this.b;
         this.b = this.c;
         this.c = var1;
         var2 = this.c();
         if (var2 != this.g()) {
            this.a(!var2);
            this.c(var2);
         }
      }

      if (this.d > this.e) {
         short var3 = this.d;
         this.d = this.e;
         this.e = var3;
         var2 = this.e();
         if (var2 != this.i()) {
            this.b(!var2);
            this.d(var2);
         }
      }

   }

   void t() {
      this.c = this.b;
      this.e = this.d;
      this.c(this.c());
      this.d(this.e());
   }

   public int hashCode() {
      return super.hashCode();
   }

   public boolean equals(Object obj) {
      if (!(obj instanceof zaye)) {
         return false;
      } else {
         zaye var2 = (zaye)obj;
         return this.b == var2.b && this.d == var2.d && this.c == var2.c && this.e == var2.e && this.b(var2.a);
      }
   }

   boolean a(int var1, int var2) {
      return this.b <= var1 && this.c >= var1 && this.d <= var2 && this.e >= var2;
   }

   boolean e(int var1) {
      return this.b <= var1 && this.c >= var1;
   }

   boolean f(int var1) {
      return this.d <= var1 && this.e >= var1;
   }

   CellArea u() {
      return CellArea.createCellArea(this.b, this.d, this.c, this.e);
   }

   Range b(zaay var1) {
      Cells var2 = null;
      if (this.a == null) {
         if (var1.e == null) {
            return null;
         }

         var2 = var1.e;
      } else {
         if ((this.a.a & '\uffff') != var1.p.i) {
            return null;
         }

         int var3 = this.a.b & '\uffff';
         if (var3 != (this.a.c & '\uffff') || var3 < 0 || var3 >= var1.p.g.getCount()) {
            return null;
         }

         var2 = var1.p.g.get(this.a.b & '\uffff').getCells();
      }

      return var2.createRange(this.b, this.d, this.c - this.b + 1, this.e - this.d + 1);
   }

   boolean b(zur var1) {
      if (this.a == var1) {
         return true;
      } else if (this.a != null && var1 != null) {
         return this.a.a == var1.a && this.a.b == var1.b && this.a.c == var1.c;
      } else {
         return false;
      }
   }

   public String toString() {
      StringBuilder var1 = new StringBuilder();
      if (this.a != null) {
         var1.append('[');
         var1.append(this.a.a);
         var1.append('-');
         var1.append(this.a.b);
         var1.append('-');
         var1.append(this.a.c);
         var1.append(']');
      }

      var1.append(CellsHelper.cellIndexToName(this.b(), this.d()));
      var1.append(':');
      var1.append(CellsHelper.cellIndexToName(this.f(), this.h()));
      return com.aspose.cells.b.a.zr.a(var1);
   }
}
